package com.ruoyi.user.service.impl;

import com.ruoyi.common.utils.DateUtils;

import com.ruoyi.user.domain.FamilyMembers1;
import com.ruoyi.user.mapper.FamilyMembers1Mapper;
import com.ruoyi.user.service.IFamilyMembers1Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 家庭信息人员Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-03-30
 */
@Service
public class FamilyMembers1ServiceImpl implements IFamilyMembers1Service
{
    @Autowired
    private FamilyMembers1Mapper familyMembers1Mapper;

    /**
     * 查询家庭信息人员
     * 
     * @param id 家庭信息人员主键
     * @return 家庭信息人员
     */
    @Override
    public FamilyMembers1 selectFamilyMembersById(Long id)
    {
        return familyMembers1Mapper.selectFamilyMembersById(id);
    }

    /**
     * 查询家庭信息人员列表
     * 
     * @param familyMembers1 家庭信息人员
     * @return 家庭信息人员
     */
    @Override
    public List<FamilyMembers1> selectFamilyMembersList(FamilyMembers1 familyMembers1)
    {
        return familyMembers1Mapper.selectFamilyMembersList(familyMembers1);
    }

    /**
     * 新增家庭信息人员
     * 
     * @param familyMembers1 家庭信息人员
     * @return 结果
     */
    @Override
    public int insertFamilyMembers(FamilyMembers1 familyMembers1)
    {
        familyMembers1.setCreateTime(DateUtils.getNowDate());
        return familyMembers1Mapper.insertFamilyMembers(familyMembers1);
    }

    /**
     * 修改家庭信息人员
     * 
     * @param familyMembers1 家庭信息人员
     * @return 结果
     */
    @Override
    public int updateFamilyMembers(FamilyMembers1 familyMembers1)
    {
        familyMembers1.setUpdateTime(DateUtils.getNowDate());
        return familyMembers1Mapper.updateFamilyMembers(familyMembers1);
    }

    /**
     * 批量删除家庭信息人员
     * 
     * @param ids 需要删除的家庭信息人员主键
     * @return 结果
     */
    @Override
    public int deleteFamilyMembersByIds(Long[] ids)
    {
        return familyMembers1Mapper.deleteFamilyMembersByIds(ids);
    }

    /**
     * 删除家庭信息人员信息
     * 
     * @param id 家庭信息人员主键
     * @return 结果
     */
    @Override
    public int deleteFamilyMembersById(Long id)
    {
        return familyMembers1Mapper.deleteFamilyMembersById(id);
    }
}
